package com.crm.system.controller.godluck;

import com.crm.common.model.DataResponse;
import com.crm.common.model.DhResponse;
import com.crm.common.model.Enum.ResponseCodeEnum;
import com.crm.model.vo.godluck.GodLuckStatisticsVO;
import com.crm.model.vo.godluck.GodLuckVO;
import com.crm.system.service.godluck.GodLuckService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 抽取上上签
 * @Author lixq-f
 * @Date 2021/4/12
 * @Version V1.0
 **/
@RestController
@RequestMapping("/godLuck")
@Slf4j
public class GodLuckController {

    @Autowired
    private GodLuckService godLuckService;


    /**
     * @Description: 获取今日上上签，每个用户当天只有三次抽取机会
     * @Param: []
     * @Return: com.crm.common.model.DataResponse
     * @Author: lixq-f
     * @Date: 2021/4/12
     **/
    @GetMapping("/godLuckOfToday")
    public DataResponse getGodLuckOfToday() {
        GodLuckVO godLuckVO = godLuckService.getGodLuckOfToday();
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(), godLuckVO);
    }


    /**
     * @Description: 今日抽签统计信息
     * @Param: []
     * @Return: com.crm.common.model.DataResponse
     * @Author: lixq-f
     * @Date: 2021/5/14
    **/
    @GetMapping("/statisticsInfoToday")
    public DataResponse godLuckStatisticsOfToday(){
        GodLuckStatisticsVO statisticsVO = godLuckService.godLuckStatisticsOfToday();
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(), statisticsVO);
    }


}
